package a2_p04_ng_sw;

public class Knoten {

	public Knoten(String name, int attr){
		this.name = name;
		knotenarttibutt = attr;
		
	}
	

public String toString(){
	return  name;
}


	


	public int getKnotenarttibutt() {
	return knotenarttibutt;
}
	public void setKnotenarttibutt(int knotenarttibutt) {
		this.knotenarttibutt = knotenarttibutt;
	}
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}

	public boolean equals(Object obj){
		if(obj instanceof Knoten){
			Knoten tmp = (Knoten)obj;
			return ((this.name.equals(tmp.getName())) && (this.knotenarttibutt == tmp.getKnotenarttibutt()));
		}
		return false;
	}
	public double dst (Knoten goal) {
		final double x_d = goal.knotenarttibutt - knotenarttibutt;
//	    final double y_d = goal.y - y;
	    
		return Math.sqrt(x_d);
	    
	    
	}
	public void setfskore(Double fscore){
		this.fskore=fscore;
	}
	public Double getfskore(){
		return fskore;
	}
	public int hashCode(){
		Integer attr = new Integer(knotenarttibutt);
		return name.hashCode() + attr.hashCode();
	}

	
	private int knotenarttibutt;
	private String name;
	private Double fskore=0.0;


}

